Left Termination of the query pattern factor_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

factor(.(X, []), X).
factor(.(X, .(Y, Xs)), T) :- ','(times(X, Y, Z), factor(.(Z, Xs), T)).
times(0, X_, 0).
times(s(X), Y, Z) :- ','(times(X, Y, XY), plus(XY, Y, Z)).
plus(0, X, X).
plus(s(X), Y, s(Z)) :- plus(X, Y, Z).

Queries:

factor(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

factor_in(.(X, .(Y, Xs)), T) → U1(X, Y, Xs, T, times_in(X, Y, Z))
times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
U1(X, Y, Xs, T, times_out(X, Y, Z)) → U2(X, Y, Xs, T, factor_in(.(Z, Xs), T))
factor_in(.(X, []), X) → factor_out(.(X, []), X)
U2(X, Y, Xs, T, factor_out(.(Z, Xs), T)) → factor_out(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in(x1, x2)  =  factor_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x3, x5)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
[]  =  []
factor_out(x1, x2)  =  factor_out(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

factor_in(.(X, .(Y, Xs)), T) → U1(X, Y, Xs, T, times_in(X, Y, Z))
times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
U1(X, Y, Xs, T, times_out(X, Y, Z)) → U2(X, Y, Xs, T, factor_in(.(Z, Xs), T))
factor_in(.(X, []), X) → factor_out(.(X, []), X)
U2(X, Y, Xs, T, factor_out(.(Z, Xs), T)) → factor_out(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in(x1, x2)  =  factor_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x3, x5)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
[]  =  []
factor_out(x1, x2)  =  factor_out(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

FACTOR_IN(.(X, .(Y, Xs)), T) → U11(X, Y, Xs, T, times_in(X, Y, Z))
FACTOR_IN(.(X, .(Y, Xs)), T) → TIMES_IN(X, Y, Z)
TIMES_IN(s(X), Y, Z) → U31(X, Y, Z, times_in(X, Y, XY))
TIMES_IN(s(X), Y, Z) → TIMES_IN(X, Y, XY)
U31(X, Y, Z, times_out(X, Y, XY)) → U41(X, Y, Z, plus_in(XY, Y, Z))
U31(X, Y, Z, times_out(X, Y, XY)) → PLUS_IN(XY, Y, Z)
PLUS_IN(s(X), Y, s(Z)) → U51(X, Y, Z, plus_in(X, Y, Z))
PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)
U11(X, Y, Xs, T, times_out(X, Y, Z)) → U21(X, Y, Xs, T, factor_in(.(Z, Xs), T))
U11(X, Y, Xs, T, times_out(X, Y, Z)) → FACTOR_IN(.(Z, Xs), T)

The TRS R consists of the following rules:

factor_in(.(X, .(Y, Xs)), T) → U1(X, Y, Xs, T, times_in(X, Y, Z))
times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
U1(X, Y, Xs, T, times_out(X, Y, Z)) → U2(X, Y, Xs, T, factor_in(.(Z, Xs), T))
factor_in(.(X, []), X) → factor_out(.(X, []), X)
U2(X, Y, Xs, T, factor_out(.(Z, Xs), T)) → factor_out(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in(x1, x2)  =  factor_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x3, x5)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
[]  =  []
factor_out(x1, x2)  =  factor_out(x2)
U51(x1, x2, x3, x4)  =  U51(x4)
TIMES_IN(x1, x2, x3)  =  TIMES_IN(x1, x2)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U41(x1, x2, x3, x4)  =  U41(x4)
FACTOR_IN(x1, x2)  =  FACTOR_IN(x1)
U21(x1, x2, x3, x4, x5)  =  U21(x5)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1, x2)
U11(x1, x2, x3, x4, x5)  =  U11(x3, x5)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

FACTOR_IN(.(X, .(Y, Xs)), T) → U11(X, Y, Xs, T, times_in(X, Y, Z))
FACTOR_IN(.(X, .(Y, Xs)), T) → TIMES_IN(X, Y, Z)
TIMES_IN(s(X), Y, Z) → U31(X, Y, Z, times_in(X, Y, XY))
TIMES_IN(s(X), Y, Z) → TIMES_IN(X, Y, XY)
U31(X, Y, Z, times_out(X, Y, XY)) → U41(X, Y, Z, plus_in(XY, Y, Z))
U31(X, Y, Z, times_out(X, Y, XY)) → PLUS_IN(XY, Y, Z)
PLUS_IN(s(X), Y, s(Z)) → U51(X, Y, Z, plus_in(X, Y, Z))
PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)
U11(X, Y, Xs, T, times_out(X, Y, Z)) → U21(X, Y, Xs, T, factor_in(.(Z, Xs), T))
U11(X, Y, Xs, T, times_out(X, Y, Z)) → FACTOR_IN(.(Z, Xs), T)

The TRS R consists of the following rules:

factor_in(.(X, .(Y, Xs)), T) → U1(X, Y, Xs, T, times_in(X, Y, Z))
times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
U1(X, Y, Xs, T, times_out(X, Y, Z)) → U2(X, Y, Xs, T, factor_in(.(Z, Xs), T))
factor_in(.(X, []), X) → factor_out(.(X, []), X)
U2(X, Y, Xs, T, factor_out(.(Z, Xs), T)) → factor_out(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in(x1, x2)  =  factor_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x3, x5)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
[]  =  []
factor_out(x1, x2)  =  factor_out(x2)
U51(x1, x2, x3, x4)  =  U51(x4)
TIMES_IN(x1, x2, x3)  =  TIMES_IN(x1, x2)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U41(x1, x2, x3, x4)  =  U41(x4)
FACTOR_IN(x1, x2)  =  FACTOR_IN(x1)
U21(x1, x2, x3, x4, x5)  =  U21(x5)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1, x2)
U11(x1, x2, x3, x4, x5)  =  U11(x3, x5)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 6 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)

The TRS R consists of the following rules:

factor_in(.(X, .(Y, Xs)), T) → U1(X, Y, Xs, T, times_in(X, Y, Z))
times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
U1(X, Y, Xs, T, times_out(X, Y, Z)) → U2(X, Y, Xs, T, factor_in(.(Z, Xs), T))
factor_in(.(X, []), X) → factor_out(.(X, []), X)
U2(X, Y, Xs, T, factor_out(.(Z, Xs), T)) → factor_out(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in(x1, x2)  =  factor_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x3, x5)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
[]  =  []
factor_out(x1, x2)  =  factor_out(x2)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN(s(X), Y, s(Z)) → PLUS_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
PLUS_IN(x1, x2, x3)  =  PLUS_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

PLUS_IN(s(X), Y) → PLUS_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

TIMES_IN(s(X), Y, Z) → TIMES_IN(X, Y, XY)

The TRS R consists of the following rules:

factor_in(.(X, .(Y, Xs)), T) → U1(X, Y, Xs, T, times_in(X, Y, Z))
times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
U1(X, Y, Xs, T, times_out(X, Y, Z)) → U2(X, Y, Xs, T, factor_in(.(Z, Xs), T))
factor_in(.(X, []), X) → factor_out(.(X, []), X)
U2(X, Y, Xs, T, factor_out(.(Z, Xs), T)) → factor_out(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in(x1, x2)  =  factor_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x3, x5)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
[]  =  []
factor_out(x1, x2)  =  factor_out(x2)
TIMES_IN(x1, x2, x3)  =  TIMES_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

TIMES_IN(s(X), Y, Z) → TIMES_IN(X, Y, XY)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
TIMES_IN(x1, x2, x3)  =  TIMES_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

TIMES_IN(s(X), Y) → TIMES_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

FACTOR_IN(.(X, .(Y, Xs)), T) → U11(X, Y, Xs, T, times_in(X, Y, Z))
U11(X, Y, Xs, T, times_out(X, Y, Z)) → FACTOR_IN(.(Z, Xs), T)

The TRS R consists of the following rules:

factor_in(.(X, .(Y, Xs)), T) → U1(X, Y, Xs, T, times_in(X, Y, Z))
times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
U1(X, Y, Xs, T, times_out(X, Y, Z)) → U2(X, Y, Xs, T, factor_in(.(Z, Xs), T))
factor_in(.(X, []), X) → factor_out(.(X, []), X)
U2(X, Y, Xs, T, factor_out(.(Z, Xs), T)) → factor_out(.(X, .(Y, Xs)), T)

The argument filtering Pi contains the following mapping:
factor_in(x1, x2)  =  factor_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x3, x5)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
[]  =  []
factor_out(x1, x2)  =  factor_out(x2)
FACTOR_IN(x1, x2)  =  FACTOR_IN(x1)
U11(x1, x2, x3, x4, x5)  =  U11(x3, x5)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

FACTOR_IN(.(X, .(Y, Xs)), T) → U11(X, Y, Xs, T, times_in(X, Y, Z))
U11(X, Y, Xs, T, times_out(X, Y, Z)) → FACTOR_IN(.(Z, Xs), T)

The TRS R consists of the following rules:

times_in(s(X), Y, Z) → U3(X, Y, Z, times_in(X, Y, XY))
times_in(0, X_, 0) → times_out(0, X_, 0)
U3(X, Y, Z, times_out(X, Y, XY)) → U4(X, Y, Z, plus_in(XY, Y, Z))
U4(X, Y, Z, plus_out(XY, Y, Z)) → times_out(s(X), Y, Z)
plus_in(s(X), Y, s(Z)) → U5(X, Y, Z, plus_in(X, Y, Z))
plus_in(0, X, X) → plus_out(0, X, X)
U5(X, Y, Z, plus_out(X, Y, Z)) → plus_out(s(X), Y, s(Z))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
times_in(x1, x2, x3)  =  times_in(x1, x2)
s(x1)  =  s(x1)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
0  =  0
times_out(x1, x2, x3)  =  times_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
plus_in(x1, x2, x3)  =  plus_in(x1, x2)
U5(x1, x2, x3, x4)  =  U5(x4)
plus_out(x1, x2, x3)  =  plus_out(x3)
FACTOR_IN(x1, x2)  =  FACTOR_IN(x1)
U11(x1, x2, x3, x4, x5)  =  U11(x3, x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

FACTOR_IN(.(X, .(Y, Xs))) → U11(Xs, times_in(X, Y))
U11(Xs, times_out(Z)) → FACTOR_IN(.(Z, Xs))

The TRS R consists of the following rules:

times_in(s(X), Y) → U3(Y, times_in(X, Y))
times_in(0, X_) → times_out(0)
U3(Y, times_out(XY)) → U4(plus_in(XY, Y))
U4(plus_out(Z)) → times_out(Z)
plus_in(s(X), Y) → U5(plus_in(X, Y))
plus_in(0, X) → plus_out(X)
U5(plus_out(Z)) → plus_out(s(Z))

The set Q consists of the following terms:

times_in(x0, x1)
U3(x0, x1)
U4(x0)
plus_in(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U11(Xs, times_out(Z)) → FACTOR_IN(.(Z, Xs))
The remaining pairs can at least be oriented weakly.

FACTOR_IN(.(X, .(Y, Xs))) → U11(Xs, times_in(X, Y))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(FACTOR_IN(x1)) = x1   
POL(U11(x1, x2)) = 1 + x1 + x2   
POL(U3(x1, x2)) = 1   
POL(U4(x1)) = 1   
POL(U5(x1)) = 0   
POL(plus_in(x1, x2)) = 0   
POL(plus_out(x1)) = 0   
POL(s(x1)) = 0   
POL(times_in(x1, x2)) = 1   
POL(times_out(x1)) = 1   

The following usable rules [17] were oriented:

times_in(0, X_) → times_out(0)
U3(Y, times_out(XY)) → U4(plus_in(XY, Y))
times_in(s(X), Y) → U3(Y, times_in(X, Y))
U4(plus_out(Z)) → times_out(Z)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

FACTOR_IN(.(X, .(Y, Xs))) → U11(Xs, times_in(X, Y))

The TRS R consists of the following rules:

times_in(s(X), Y) → U3(Y, times_in(X, Y))
times_in(0, X_) → times_out(0)
U3(Y, times_out(XY)) → U4(plus_in(XY, Y))
U4(plus_out(Z)) → times_out(Z)
plus_in(s(X), Y) → U5(plus_in(X, Y))
plus_in(0, X) → plus_out(X)
U5(plus_out(Z)) → plus_out(s(Z))

The set Q consists of the following terms:

times_in(x0, x1)
U3(x0, x1)
U4(x0)
plus_in(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.